<template>
	<view class="seckill-page">
		<!-- 刷新按钮 -->
		<view class="refresh-bar">
			<button class="refresh-btn" @tap="refreshData">
				<text class="refresh-icon">🔄</text>
				<text>刷新</text>
			</button>
		</view>
		
		<!-- 倒计时区域 -->
		<view class="countdown-area">
			<view class="title">整点秒杀</view>
			<view class="subtitle">每日 10:00 14:00 20:00 开抢</view>
			<view class="next-time">距离下次开抢：{{nextSeckillTime}}</view>
			
			<!-- 当前时间段信息 -->
			<view v-if="currentSeckillStatus.hasActive || currentSeckillStatus.hasUpcoming" class="current-period">
				<text class="period-text">
					{{currentSeckillStatus.hasActive ? '🔥 当前抢购时段' : '⏰ 即将开始时段'}}: 
					{{currentSeckillStatus.hasActive ? currentSeckillStatus.activeTime : currentSeckillStatus.upcomingTime}}
				</text>
			</view>
			
			<view class="timer">
				<view class="time-item">
					<text class="number">{{countdown.hours}}</text>
					<text class="label">时</text>
				</view>
				<text class="separator">:</text>
				<view class="time-item">
					<text class="number">{{countdown.minutes}}</text>
					<text class="label">分</text>
				</view>
				<text class="separator">:</text>
				<view class="time-item">
					<text class="number">{{countdown.seconds}}</text>
					<text class="label">秒</text>
				</view>
			</view>
		</view>

		<!-- 商品列表 -->
		<view class="product-list">
			<view v-if="loading" class="loading">正在加载...</view>
			<view v-else-if="Object.keys(seckillGroups).length === 0" class="no-data">
				<view class="no-seckill-tip">
					<text class="tip-icon">⏰</text>
					<text class="tip-title">暂无秒杀活动</text>
					<text class="tip-desc">距离下次秒杀还有 {{countdown.hours}}:{{countdown.minutes}}:{{countdown.seconds}}</text>
					<view class="tip-info">
						<text>今日秒杀时间：10:00、14:00、20:00</text>
					</view>
				</view>
			</view>
			<view v-else>
				<!-- 当前状态提示 -->
				<view v-if="currentSeckillStatus.hasActive" class="status-banner active">
					<text class="status-text">🔥 正在抢购中 - {{currentSeckillStatus.activeTime}}</text>
				</view>
				<view v-else-if="currentSeckillStatus.hasUpcoming" class="status-banner upcoming">
					<text class="status-text">⏰ 即将开始 - {{currentSeckillStatus.upcomingTime}}</text>
				</view>
				
				<view class="time-group" v-for="(products, timeKey) in seckillGroups" :key="timeKey">
					<view class="group-header">
						<view class="group-time">{{formatGroupTime(timeKey)}}</view>
						<view class="group-status">{{getGroupStatus(products[0])}}</view>
					</view>
					<view class="group-products">
						<view class="product-item" v-for="item in products" :key="item.id">
							<image class="product-img" :src="getImageUrl(item.imgs)" mode="aspectFill"></image>
							<view class="product-info">
								<view class="product-name">{{item.name}}</view>
								<view class="price-info">
									<text class="seckill-price">¥{{item.seckillPrice}}</text>
									<text class="original-price">¥{{item.price}}</text>
								</view>
								<view class="stock-info">
									<text>剩余{{item.seckillStock}}件</text>
								</view>
								<view class="status-info">
									<text class="status-text">{{item.status}}</text>
								</view>
								<button class="buy-btn" @tap="buyNow(item)" :disabled="!canBuy(item)">
									{{getButtonText(item)}}
								</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import goods from '@/utils/goods.js'

export default {
	data() {
		return {
			countdown: {
				hours: '00',
				minutes: '00',
				seconds: '00'
			},
			seckillGroups: {},
			loading: true,
			timer: null,
			nextSeckillTime: ''
		}
	},
	computed: {
		// 获取当前秒杀状态
		currentSeckillStatus() {
			const now = new Date().getTime();
			const seckillHours = [10, 14, 20];
			
			let status = {
				hasActive: false,
				hasUpcoming: false,
				activeTime: '',
				upcomingTime: '',
				currentHour: null
			};
			
			// 检查当前是否在某个秒杀时间段内
			for (let i = 0; i < seckillHours.length; i++) {
				const hour = seckillHours[i];
				const startTime = new Date();
				startTime.setHours(hour, 0, 0, 0);
				let endTime = new Date(startTime);
				
				// 20点的活动持续到明天10点
				if (hour === 20) {
					endTime.setDate(endTime.getDate() + 1);
					endTime.setHours(10, 0, 0, 0);
				} else {
					// 其他时间段持续1小时
					endTime.setHours(hour + 1, 0, 0, 0);
				}
				
				// 如果当前时间在这个时间段内
				if (now >= startTime.getTime() && now < endTime.getTime()) {
					status.hasActive = true;
					status.activeTime = this.formatGroupTime(startTime.toISOString().replace('T', ' ').substring(0, 19));
					status.currentHour = hour;
					break;
				}
			}
			
			// 如果没有找到当前时间段，检查是否在即将开始的时间段
			if (!status.hasActive) {
				for (let i = 0; i < seckillHours.length; i++) {
					const hour = seckillHours[i];
					const startTime = new Date();
					startTime.setHours(hour, 0, 0, 0);
					const timeUntilStart = startTime.getTime() - now;
					const thirtyMinutes = 30 * 60 * 1000; // 30分钟
					
					if (timeUntilStart > 0 && timeUntilStart <= thirtyMinutes) {
						status.hasUpcoming = true;
						status.upcomingTime = this.formatGroupTime(startTime.toISOString().replace('T', ' ').substring(0, 19));
						status.currentHour = hour;
						break;
					}
				}
			}
			
			return status;
		}
	},
	onLoad() {
		this.loadSeckillData();
		this.startCountdown();
		
		// 如果2秒后还没有数据，显示提示
		setTimeout(() => {
			if (Object.keys(this.seckillGroups).length === 0) {
				uni.showToast({
					title: '暂无秒杀数据',
					icon: 'none',
					duration: 2000
				});
			}
		}, 2000);
	},
	onUnload() {
		if (this.timer) {
			clearInterval(this.timer);
		}
	},
	// 下拉刷新
	onPullDownRefresh() {
		this.refreshData();
	},
	methods: {
		// 加载秒杀数据
		async loadSeckillData() {
			this.loading = true;
			try {
				const res = await goods.getSeckillList({});
				
				if (res && res.code === 200 && res.data) {
					this.seckillGroups = res.data;
					this.updateProductStatus();
				} else {
					// 没有数据，显示提示
					uni.showToast({
						title: '暂无秒杀数据',
						icon: 'none',
						duration: 2000
					});
				}
			} catch (err) {
				// 加载失败，显示错误信息
				uni.showToast({
					title: '加载失败',
					icon: 'error',
					duration: 2000
				});
			} finally {
				this.loading = false;
			}
		},
		
		
		

		
		// 更新商品状态
		updateProductStatus() {
			const now = new Date().getTime();
			const currentTimeGroups = {};
			
			// 获取当前时间信息
			const currentDate = new Date();
			const currentHour = currentDate.getHours();
			const currentDay = currentDate.getDate();
			
			// 定义秒杀时间点：10:00, 14:00, 20:00
			const seckillHours = [10, 14, 20];
			
			// 确定当前应该显示的时间段
			let displayTime = null;
			let displayHour = null;
			
			// 如果当前时间在20点到明天10点之间，显示20点的数据
			if (currentHour >= 20 || currentHour < 10) {
				// 如果当前时间在20点之后，显示今天的20点数据
				if (currentHour >= 20) {
					displayTime = new Date(currentDate);
					displayTime.setHours(20, 0, 0, 0);
					displayHour = 20;
				}
				// 如果当前时间在10点之前，显示昨天的20点数据
				else {
					displayTime = new Date(currentDate);
					displayTime.setDate(displayTime.getDate() - 1);
					displayTime.setHours(20, 0, 0, 0);
					displayHour = 20;
				}
			}
			// 如果当前时间在10点到14点之间，显示10点的数据
			else if (currentHour >= 10 && currentHour < 14) {
				displayTime = new Date(currentDate);
				displayTime.setHours(10, 0, 0, 0);
				displayHour = 10;
			}
			// 如果当前时间在14点到20点之间，显示14点的数据
			else if (currentHour >= 14 && currentHour < 20) {
				displayTime = new Date(currentDate);
				displayTime.setHours(14, 0, 0, 0);
				displayHour = 14;
			}
			
			// 如果找到了时间段，显示对应的商品
			if (displayTime) {
				// 由于数据库中的数据是15号的，我们直接使用15号的数据
				const timeKey = '2025-08-15 ' + String(displayTime.getHours()).padStart(2, '0') + ':00:00';
				
				// 检查是否有这个时间段的商品数据
				if (this.seckillGroups[timeKey]) {
					currentTimeGroups[timeKey] = this.seckillGroups[timeKey].map((item, index) => {
						// 根据当前时间段设置商品状态
						if (displayHour === 20) {
							// 20点的商品在20点到明天10点之间都是抢购中
							item.status = '抢购中';
							// 确保有库存
							if (item.seckillStock <= 0) {
								item.seckillStock = 10;
							}
						} else if (displayHour === 10) {
							// 10点的商品在10点到14点之间是抢购中
							item.status = '抢购中';
							// 确保有库存
							if (item.seckillStock <= 0) {
								item.seckillStock = 10;
							}
						} else if (displayHour === 14) {
							// 14点的商品在14点到20点之间是抢购中
							item.status = '抢购中';
							// 确保有库存
							if (item.seckillStock <= 0) {
								item.seckillStock = 10;
							}
						}
						
						return item;
					});
				}
			}
			
			// 更新显示的时间组
			this.seckillGroups = currentTimeGroups;
		},
		
		// 检查是否可以购买
		canBuy(item) {
			return item.seckillStock > 0 && item.status === '抢购中' && item.status !== '已抢完';
		},
		
		// 获取按钮文本
		getButtonText(item) {
			if (item.seckillStock <= 0 || item.status === '已抢完') {
				return '已抢完';
			}
			if (item.status === '即将开始') {
				return '即将开始';
			}
			if (item.status === '已结束') {
				return '已结束';
			}
			return '立即抢购';
		},
		
		// 格式化分组时间
		formatGroupTime(timeStr) {
			const date = new Date(timeStr);
			const month = String(date.getMonth() + 1).padStart(2, '0');
			const day = String(date.getDate()).padStart(2, '0');
			const hours = String(date.getHours()).padStart(2, '0');
			const minutes = String(date.getMinutes()).padStart(2, '0');
			return `${month}月${day}日 ${hours}:${minutes}`;
		},
		
		// 获取分组状态
		getGroupStatus(item) {
			return item.status;
		},
		
		// 获取图片URL
		getImageUrl(imgPath) {
			if (!imgPath) {
				return '/static/img/goods/p1.jpg';
			}
			// 如果是完整的URL（OSS链接），直接返回
			if (imgPath.startsWith('http://') || imgPath.startsWith('https://')) {
				return imgPath;
			}
			// 如果是本地图片路径，使用默认图片
			const defaultImages = ['p1.jpg', 'p2.jpg', 'p3.jpg', 'p4.jpg', 'p5.jpg'];
			const randomImage = defaultImages[Math.floor(Math.random() * defaultImages.length)];
			return `/static/img/goods/${randomImage}`;
		},
		
		// 开始倒计时
		startCountdown() {
			this.updateCountdown();
			this.timer = setInterval(() => {
				this.updateCountdown();
				this.updateProductStatus(); // 每秒更新商品状态
				this.checkPeriodSwitch(); // 检查时间段切换
			}, 1000);
		},
		
		// 更新倒计时
		updateCountdown() {
			const now = new Date();
			const currentHour = now.getHours();
			const currentMinute = now.getMinutes();
			
			// 定义秒杀时间点：10:00, 14:00, 20:00
			const seckillHours = [10, 14, 20];
			
			// 找到下一个秒杀时间点
			let nextSeckillTime = null;
			let nextSeckillHour = null;
			
			// 检查当前是否在某个秒杀时间段内
			let isInSeckillPeriod = false;
			for (let hour of seckillHours) {
				const seckillTime = new Date(now);
				seckillTime.setHours(hour, 0, 0, 0);
				let endTime = new Date(seckillTime);
				
				// 20点的活动持续到明天10点
				if (hour === 20) {
					endTime.setDate(endTime.getDate() + 1);
					endTime.setHours(10, 0, 0, 0);
				} else {
					// 其他时间段持续1小时
					endTime.setHours(hour + 1, 0, 0, 0);
				}
				
				if (now >= seckillTime && now < endTime) {
					isInSeckillPeriod = true;
					// 当前在秒杀时间段内，下一个时间段是下一个秒杀时间点
					// 找到下一个秒杀时间点
					for (let nextHour of seckillHours) {
						if (nextHour > hour) {
							const nextTime = new Date(now);
							nextTime.setHours(nextHour, 0, 0, 0);
							nextSeckillTime = nextTime;
							nextSeckillHour = nextHour;
							break;
						}
					}
					break;
				}
			}
			
			// 如果当前不在秒杀时间段内，找下一个秒杀时间点
			if (!isInSeckillPeriod) {
				for (let hour of seckillHours) {
					const seckillTime = new Date(now);
					seckillTime.setHours(hour, 0, 0, 0);
					
					// 如果今天的这个时间点还没到，就是下一个
					if (seckillTime > now) {
						nextSeckillTime = seckillTime;
						nextSeckillHour = hour;
						break;
					}
				}
			}
			
			// 如果今天没有下一个时间点，找明天的第一个
			if (!nextSeckillTime) {
				const tomorrow = new Date(now);
				tomorrow.setDate(tomorrow.getDate() + 1);
				tomorrow.setHours(seckillHours[0], 0, 0, 0);
				nextSeckillTime = tomorrow;
				nextSeckillHour = seckillHours[0];
			}
			
			// 更新下一个活动时间显示
			const month = String(nextSeckillTime.getMonth() + 1).padStart(2, '0');
			const day = String(nextSeckillTime.getDate()).padStart(2, '0');
			const hour = String(nextSeckillTime.getHours()).padStart(2, '0');
			const minute = String(nextSeckillTime.getMinutes()).padStart(2, '0');
			this.nextSeckillTime = `${month}月${day}日 ${hour}:${minute}`;
			
			// 计算时间差
			const diff = nextSeckillTime.getTime() - now.getTime();
			const hours = Math.floor(diff / (1000 * 60 * 60));
			const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
			const seconds = Math.floor((diff % (1000 * 60)) / 1000);
			
			this.countdown.hours = String(hours).padStart(2, '0');
			this.countdown.minutes = String(minutes).padStart(2, '0');
			this.countdown.seconds = String(seconds).padStart(2, '0');
		},
		
		// 立即抢购
		buyNow(item) {
			if (item.seckillStock <= 0) {
				uni.showToast({
					title: '商品已抢完',
					icon: 'none'
				});
				return;
			}
			
			if (item.status !== '抢购中') {
				uni.showToast({
					title: item.status === '即将开始' ? '秒杀还未开始' : '秒杀已结束',
					icon: 'none'
				});
				return;
			}
			
			uni.showModal({
				title: '确认抢购',
				content: `确定要抢购 ${item.name} 吗？\n秒杀价：¥${item.seckillPrice}`,
				success: (res) => {
					if (res.confirm) {
						this.performSeckill(item);
					}
				}
			});
		},
		
		// 执行秒杀抢购
		async performSeckill(item) {
			uni.showLoading({
				title: '抢购中...'
			});
			
			try {
				// 第一步：获取秒杀token
				const tokenRes = await goods.getSeckillToken();
				
				if (!tokenRes || tokenRes.code !== 200 || !tokenRes.data) {
					throw new Error('获取抢购令牌失败');
				}
				
				const token = tokenRes.data;
				
				// 第二步：执行秒杀抢购
				const seckillData = {
					goodsId: item.goodsId,
					token: token
				};
				
				console.log('发送秒杀数据:', seckillData);
				console.log('商品ID类型:', typeof item.goodsId);
				console.log('Token类型:', typeof token);
				
				const seckillRes = await goods.seckill(seckillData);
				
				uni.hideLoading();
				
				if (seckillRes && seckillRes.code === 200) {
					// 抢购成功，获取到秒杀资格
					const seckillResult = seckillRes.data;
					
					// 跳转到确认订单页面，不更新本地库存（因为还没有真正扣减）
					uni.navigateTo({
						url: `/pages/order/confirmation?goodsId=${item.goodsId}&goodsName=${encodeURIComponent(seckillResult.name)}&price=${seckillResult.seckillPrice}&img=${encodeURIComponent(seckillResult.img || item.img)}&type=seckill&token=${seckillResult.token || ''}`
					});
				} else {
					// 抢购失败
					const errorMsg = seckillRes?.msg || '抢购失败，请稍后重试';
					uni.showModal({
						title: '抢购失败',
						content: errorMsg,
						showCancel: false,
						confirmText: '确定'
					});
				}
				
			} catch (error) {
				uni.hideLoading();
				
				console.log('秒杀请求错误:', error);
				console.log('错误详情:', error.response);
				
				// 根据错误类型显示不同的提示
				let errorMessage = '网络错误，请稍后重试';
				
				if (error.status === 404) {
					errorMessage = '接口未找到，请检查后端服务';
				} else if (error.status === 500) {
					errorMessage = '服务器内部错误，请稍后重试';
				} else if (error.message && error.message.includes('request:ok')) {
					errorMessage = '接口调用失败，请检查网络连接';
				} else if (error.message) {
					errorMessage = error.message;
				}
				
				uni.showModal({
					title: '抢购失败',
					content: errorMessage,
					showCancel: false,
					confirmText: '确定'
				});
			}
		},
		
		// 更新本地秒杀数据
		updateLocalSeckillData(item, seckillResult) {
			// 更新商品库存
			item.seckillStock = seckillResult.seckillStock;
			
			// 如果库存为0，更新状态为已抢完
			if (item.seckillStock <= 0) {
				item.status = '已抢完';
			}
			
			// 强制更新视图
			this.$forceUpdate();
		},
		
		// 检查时间段切换
		checkPeriodSwitch() {
			const now = new Date();
			const currentHour = now.getHours();
			const currentMinute = now.getMinutes();
			
			// 如果正好到达整点，重新加载数据
			if (currentMinute === 0) {
				// 检查是否需要切换到新的时间段
				const seckillHours = [10, 14, 20];
				const isSeckillHour = seckillHours.includes(currentHour);
				
				if (isSeckillHour) {
					// 如果是秒杀时间点，重新加载数据
					this.loadSeckillData();
				} else {
					// 如果不是秒杀时间点，只更新商品状态
					this.updateProductStatus();
				}
			}
		},
		
		// 刷新数据
		async refreshData() {
			try {
				uni.showLoading({
					title: '刷新中...'
				});
				
				await this.loadSeckillData();
				
				uni.hideLoading();
				uni.showToast({
					title: '刷新成功',
					icon: 'success',
					duration: 1500
				});
			} catch (error) {
				uni.hideLoading();
				uni.showToast({
					title: '刷新失败',
					icon: 'none',
					duration: 1500
				});
			} finally {
				uni.stopPullDownRefresh();
			}
		},
		

	}
};
</script>

<style lang="scss">
.seckill-page {
	min-height: 100vh;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	padding: 20rpx;
	padding-top: 80rpx; /* 为固定定位的刷新按钮留出空间 */
}

.refresh-bar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background: rgba(255, 255, 255, 0.1);
	padding: 10rpx 20rpx;
	z-index: 10;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 15rpx;
	backdrop-filter: blur(10rpx);
	
	.refresh-btn {
		background: rgba(255, 255, 255, 0.2);
		border-radius: 30rpx;
		padding: 10rpx 15rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
		font-size: 24rpx;
		border: none;
		transition: all 0.3s ease;
		
		&:active {
			background: rgba(255, 255, 255, 0.3);
			transform: scale(0.95);
		}
	}
	
	.refresh-icon {
		margin-right: 8rpx;
		font-size: 20rpx;
	}
	

}

.countdown-area {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 20rpx;
	padding: 40rpx 30rpx;
	margin-bottom: 30rpx;
	backdrop-filter: blur(10rpx);
	
	.title {
		font-size: 48rpx;
		font-weight: bold;
		color: #fff;
		text-align: center;
		margin-bottom: 10rpx;
	}
	
	.subtitle {
		font-size: 28rpx;
		color: rgba(255, 255, 255, 0.8);
		text-align: center;
		margin-bottom: 15rpx;
	}
	
	.next-time {
		font-size: 26rpx;
		color: #ffeb3b;
		text-align: center;
		margin-bottom: 30rpx;
		font-weight: bold;
	}
	
	.current-period {
		background: rgba(255, 255, 255, 0.2);
		border-radius: 15rpx;
		padding: 15rpx 20rpx;
		margin-bottom: 30rpx;
		text-align: center;
		color: #fff;
		font-size: 26rpx;
		font-weight: bold;
		backdrop-filter: blur(5rpx);
	}
	
	.timer {
		display: flex;
		justify-content: center;
		align-items: center;
		
		.time-item {
			background: rgba(255, 255, 255, 0.2);
			border-radius: 12rpx;
			padding: 20rpx 15rpx;
			margin: 0 10rpx;
			min-width: 80rpx;
			text-align: center;
			
			.number {
				display: block;
				font-size: 36rpx;
				font-weight: bold;
				color: #fff;
				margin-bottom: 5rpx;
			}
			
			.label {
				font-size: 24rpx;
				color: rgba(255, 255, 255, 0.8);
			}
		}
		
		.separator {
			font-size: 36rpx;
			color: #fff;
			font-weight: bold;
		}
	}
}

.product-list {
	.loading, .no-data {
		text-align: center;
		color: rgba(255, 255, 255, 0.8);
		font-size: 28rpx;
		padding: 60rpx 0;
		background: rgba(255, 255, 255, 0.1);
		border-radius: 20rpx;
		margin: 20rpx 0;
	}
	
	.no-seckill-tip {
		padding: 40rpx 20rpx;
		text-align: center;
		
		.tip-icon {
			font-size: 60rpx;
			margin-bottom: 10rpx;
		}
		
		.tip-title {
			font-size: 36rpx;
			font-weight: bold;
			color: #fff;
			margin-bottom: 10rpx;
		}
		
		.tip-desc {
			font-size: 26rpx;
			color: rgba(255, 255, 255, 0.8);
		}
		.tip-info {
			margin-top: 20rpx;
			font-size: 24rpx;
			color: rgba(255, 255, 255, 0.7);
		}
	}
	
	.status-banner {
		background: rgba(255, 255, 255, 0.2);
		border-radius: 15rpx;
		padding: 15rpx 20rpx;
		margin: 20rpx 0;
		text-align: center;
		color: #fff;
		font-size: 28rpx;
		font-weight: bold;
		backdrop-filter: blur(5rpx);
		
		&.active {
			background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
		}
		
		&.upcoming {
			background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
		}
	}
	
	.time-group {
		margin-bottom: 30rpx;
		
		.group-header {
			background: rgba(255, 255, 255, 0.15);
			border-radius: 15rpx;
			padding: 20rpx;
			margin-bottom: 15rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.group-time {
				font-size: 32rpx;
				font-weight: bold;
				color: #fff;
			}
			
			.group-status {
				font-size: 26rpx;
				color: #ffeb3b;
				background: rgba(255, 235, 59, 0.2);
				padding: 8rpx 16rpx;
				border-radius: 20rpx;
			}
		}
		
		.group-products {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			
			.product-item {
				width: 48%;
				background: #fff;
				border-radius: 15rpx;
				margin-bottom: 15rpx;
				overflow: hidden;
				box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.1);
				
				.product-img {
					width: 100%;
					height: 200rpx;
				}
				
				.product-info {
					padding: 15rpx;
					
					.product-name {
						font-size: 28rpx;
						font-weight: bold;
						color: #333;
						margin-bottom: 10rpx;
						line-height: 1.3;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
					
					.price-info {
						margin-bottom: 10rpx;
						
						.seckill-price {
							font-size: 30rpx;
							font-weight: bold;
							color: #ff4757;
							margin-right: 10rpx;
						}
						
						.original-price {
							font-size: 24rpx;
							color: #999;
							text-decoration: line-through;
						}
					}
					
					.stock-info {
						margin-bottom: 8rpx;
						
						text {
							font-size: 24rpx;
							color: #666;
						}
					}
					
					.status-info {
						margin-bottom: 15rpx;
						
						.status-text {
							font-size: 22rpx;
							color: #ff4757;
							font-weight: bold;
						}
					}
					
					.buy-btn {
						width: 100%;
						height: 60rpx;
						background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
						color: #fff;
						border: none;
						border-radius: 30rpx;
						font-size: 26rpx;
						font-weight: bold;
						
						&:disabled {
							background: #ccc;
							color: #999;
						}
					}
				}
			}
		}
	}
}
</style>
